home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 26 / PC Gamer IT CD 26 1-2.iso / MEDIA / NET.DXR / Internal_3_Preferences Stuff.ls < prev    next >
Encoding:
Text File  |  1997-11-05  |  1.2 KB  |  39 lines

  1. on getPrefThingy
  2.   global myFile
  3.   set gOSDir to getOSDirectory()
  4.   put gOSDir & "\" into field "OSPath"
  5.   set i to gOSDir & "\Prefs.TXT"
  6.   set DaPath to i
  7.   if objectp(myFile) then
  8.     set myFile to 0
  9.   end if
  10.   set myFile to new(xtra("fileio"))
  11.   openFile(myFile, DaPath, 1)
  12.   set thePrefs to readLine(myFile)
  13.   put thePrefs into field "the preferences"
  14.   closeFile(myFile)
  15.   set myFile to 0
  16.   put item 1 of field "The Preferences" into field "cdDrive"
  17.   put item 2 of field "The Preferences" into field "browserSelect"
  18.   put item 3 of field "The Preferences" into field "pathtoproj"
  19.   put item 4 of field "the preferences" into field "emailSelect"
  20. end
  21.  
  22. on doPrefThingy
  23.   global myFile
  24.   if objectp(myFile) then
  25.     set myFile to 0
  26.   end if
  27.   set myFile to new(xtra("fileio"))
  28.   set gOSDir to getOSDirectory()
  29.   set finalPath to gOSDir & "\"
  30.   openFile(myFile, finalPath & "Prefs.TXT", 0)
  31.   if status(myFile) = 0 then
  32.     delete(myFile)
  33.     closeFile(myFile)
  34.   end if
  35.   createFile(myFile, finalPath & "Prefs.TXT")
  36.   openFile(myFile, finalPath & "Prefs.TXT", 0)
  37.   writeString(myFile, field "cdDrive" & "," & field "browserSelect" & "," & field "pathToProj" & "," & field "emailSelect")
  38. end
  39.